/*****************************************************
*                                                                          
*               COPYRIGHT (c) 2015-2017 Broadlink Corporation              
*                         All Rights Reserved                              
*                                                                          
* The source code contained or described herein and all documents          
* related to the source code ("Material") are owned by Broadlink         
* Corporation or its licensors.  Title to the Material remains             
* with Broadlink Corporation or its suppliers and licensors.               
*                                                                          
* The Material is protected by worldwide copyright and trade secret        
* laws and treaty provisions. No part of the Material may be used,         
* copied, reproduced, modified, published, uploaded, posted, transmitted,  
* distributed, or disclosed in any way except in accordance with the       
* applicable license agreement.                                            
*                                                                          
* No license under any patent, copyright, trade secret or other            
* intellectual property right is granted to or conferred upon you by       
* disclosure or delivery of the Materials, either expressly, by            
* implication, inducement, estoppel, except in accordance with the         
* applicable license agreement.                                            
*                                                                          
* Unless otherwise agreed by Broadlink in writing, you may not remove or   
* alter this notice or any other notice embedded in Materials by Broadlink 
* or Broadlink's suppliers or licensors in any way.                        
*                                                                          
** Author: shengda.huang
** Date: 2019-02-18
*
*****************************************************/

#ifndef __DYMEM_ADAPTER_H_
#define __DYMEM_ADAPTER_H_

#ifdef __cplusplus
extern "C"{
#endif

/***** INCLUDES *************************************/
#include <assert.h>

/***** DEFINES **************************************/
#ifndef DYMEM_DEBUG_LOG_ENABLE
# define dymem_log(_fmt_, ...)
#else
# define dymem_log(_fmt_, ...)        	printf("[DYMEM][%s:%d][%s] "_fmt_"\r\n", __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#endif
#define dymem_log_wrn(_fmt_, ...)      	printf("[DYMEM][WRN][%s:%d][%s] "_fmt_"\r\n", __FILE__, __LINE__, __func__, ##__VA_ARGS__)
#define dymem_log_err(_fmt_, ...)      	printf("[DYMEM][ERR][%s:%d][%s] "_fmt_"\r\n", __FILE__, __LINE__, __func__, ##__VA_ARGS__)


#ifdef DYMEM_ASSERT_ENABLE
#define RT_ASSERT assert
#else
#define RT_ASSERT (void)
#endif

/***** TYPEDEFS *************************************/

/***** CONSTANTS ************************************/

/***** VARIABLES ************************************/

/***** EXTERNAL VARIABLES ***************************/

/***** EXTERNAL FUNCTIONS ***************************/

/***** PROTOTYPES ***********************************/
void dymem_adapter_init(void);
int dymem_adapter_sem_wait(void);
int dymem_adapter_sem_post(void);


#ifdef __cplusplus
}
#endif

#endif /* __DYMEM_ADAPTER_H_ */

